package com.example.xln111.service;

import com.example.xln111.Dao.StudentMapper;
import com.example.xln111.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    private StudentMapper StudentDao;

    public List<Student> getAllStudents(){
        return StudentDao.getAll();
    }

    public int add(Student student){
        return StudentDao.addStudent(student);
    }

    public int update(Student student){
        return StudentDao.updateStudent(student);
    }

    public int deleteById(int id){
        return StudentDao.deleteStudentById(id);
    }

    public Student getById(int id){
        return StudentDao.getStudentById(id);
    }
}

